
<style type="text/css">

      #index {
        -moz-box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Для Firefox */
        -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Для Safari и Chrome */
        box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Параметры тени */
width:50%;
margin-left: 20%;
margin-top: 20px;
border-style: solid;
border-width: 1px;
border-radius: 2px;
padding: 10px;

}
      body {
      	background-color: #f5f5f5;
      }

      .container {
      	 

      }

      .form-signin {
      	opacity: 0.9;
        max-width: 300px;
        padding: 19px 29px 29px;
        margin: 0 auto 5px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
      .form-signin .form-signin-heading,
      .form-signin .checkbox {
        margin-bottom: 10px;
      }


      .form-register {
        opacity: 0.9;
        max-width: 300px;
        padding: 5px 29px 20px;
        margin: 0 auto 20px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }

      .header {
        padding-left: 23%;
      	height: 40px;
      	margin-bottom: 0px;
      	background-color: #006dcc;
    	 *background-color: #0044cc;
    	  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
    	  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
    	  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
    	  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
    	  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
    	  background-repeat: repeat-x;
    	  border-color: #0044cc #0044cc #002a80;
    	  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
      }
      .wrapper {
        height: 100%;
      }
      .content {
        height: 100%;  
        margin-top: 10px;
        -moz-box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Для Firefox */
        -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Для Safari и Chrome */
        box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Параметры тени */

        margin-left: 23%;
        width:700px;      
        padding: 10px;
        background-color: rgba(100, 100, 255, 0.1);
        border-color: rgba(0, 0, 0, 0.1) rgba(255, 0, 255, 0.1) rgba(255, 255, 0, 0.25);
      }

      .search {
        padding-top: 5px;
        margin-left: 100px;
        float:left;
      }
      
      .profile {
        float:right;
        color:white;
        margin-right: 10px;
        margin-top: 7px;
        font-weight: bold;
      }
      .logout {
        float:right;
        color:white;
        margin-right: 100px;
        margin-top: 7px;
        font-weight: bold;
      }
</style>


<div class="header">
 <ul class="nav nav-tabs">
     <li><%= link_to "Home", {:action=>"mainpage"} %></li>
        <li><%= link_to "Calendar", {:action=>"calendar"} %></li>
        <li class="active"><%= link_to "My Activities", {:action=>"myactivities"} %></li>        
                <li><%= link_to "Groups", {:action=>"groups"} %></li>        
        <li><%= link_to "Students", {:action=>"students"} %></li>            
    <li><%= link_to "To approve #{@users.size}", {:action=>"approve"} %></li>
    <li><%= link_to "Profile", {:action=>"profile",:id=>session[:userid]} %></li>
    <li><%= link_to "Log out", {:action=>"logout"} %></li>
  </ul>
  
   
</div>
<div class="wrapper">

<div class="content">
  <div class="post">
     <% @activities.each do |activity| %>
  
  <div id="index">
      <div id="header">
        <div id="left">
          <%= activity.name %>
        </div>
        <div id="right">
          <%= link_to "Edit", edit_activity_path(activity) %>
          <%= link_to "Delete", activity,confirm: 'Are you sure?', method: :delete %>
        </div>

      </div>
      <div id="content">
        <h4> Description: </h4>
        <%= activity.description %> 
        </div>
        <div id="content">
        <h4> Likes: </h4>
        <%= activity.likes %> 
        </div>

        <div id="timeleft">
          <h4> Activity will start in: </h4>
          <%  s = activity.todo_time.to_i - Time.now.to_i - 21600;
            m = s / 60
            s = s % 60
            h = m / 60
            m = m % 60
            d = h / 24
            h = h % 24
          %>
          <p><%= "#{d} days, #{h} hours, #{m} minutes, #{s} seconds" %></p>
      </div>
  </div>

<% end %>
<%= link_to 'New Activity', new_activity_path,:class=>"btn btn-primary" %>

  </div>
  </div>
</div>


